#!/bin/bash
# Date: 2021.05.07
# 直接下载网页并保存为 html

### Description:
###     GetHtml — download html file from web url
###
### Author:
###     Shieber <QMH_XB_FLTMY@yahoo.com>
###
### Usage:
###     GetHtml <url>
###
### Options:
###     <url>       Input url to download.
###     -h,--help   Show help message.
###
### Example:
###     GetHtml https://www.baidu.com
help() {
    sed -rn 's/^### ?//;T;p' "$0"
}


if [[ $# == 0 ]] || [[ "$1" == "-h" ]] || [[ "$1" == "--help" ]]; then
    help
    exit 1
else                               #参数为url，构造下载地址并下载
    curl $1 -o download.html
fi
